<template>
    <div class='recommemd'></div>
</template>
<script lang='ts' setup>
import { useAccount } from '@/stores/account';
import { useLayout } from '@/stores/layout';
import { useUser } from '@/stores/user';
import { onMounted } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const account = useAccount();
const user = useUser();
const layout = useLayout();
onMounted(() => {
    const code = location.href.split("/recommend/").pop();
    console.log("code", code);
    if (code !== undefined) {
        setTimeout(() => {
            // if (!user.isLogin) {
            localStorage.setItem('code', code);

            if (layout.isMobile) {
                location.href = "/register";
                return;
            }
            // }
            if (!user.info) {
                account.changePopRegister(true);
            }
            router.push('/');
        }, 30);
    }
});
</script>
<style lang='less' scoped></style>